<!-- -----------------------v.3 ------------------------------------------------->

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<c:url value="/css/tableStyle.css"/>" />
<title>Setting - Insured Item</title>
<style>
</style>
<script>
	window.onload = function(){
		document.getElementById("btn_insert").onclick = insert;
	};

	function insert(){
		document.getElementById("row_insert").style.display = "";
	};
</script>
</head>
<body>

<h1>Address Zip</h1>
<s:form namespace="/setting" method="post" action="addrZip">
	Code<s:textfield name="model.addrCode" value=""/>
	<s:submit cssClass="button" value="搜尋" method="select"></s:submit>
</s:form>
<input class="button1" type="button" id="btn_insert" value="新增"/>
<table style="width:1000px;">
	<thead>
		<tr>
			<th>FUNCTION</th>
			<th>CODE</th>
			<th>NAME</th>
			<th>Creator</th>
			<th>CreateTime</th>
			<th>Modifier</th>
			<th>ModifiedTime</th>
		</tr>
	</thead>
	<s:form namespace="/setting" method="post" action="addrZip">
		<tr id="row_insert" style="display: none;">
			<td>
				<s:submit cssClass="button1" value="送出" method="insert"/>
				<s:submit cssClass="button1" value="取消"/>		
			</td>
			<td><s:textfield name="model.addrCode" value=""/></td>
			<td><s:textfield name="model.addrName" value=""/></td>
			<td><s:textfield disabled="true" name="model.creator" value=""/></td>
			<td><s:textfield disabled="true" name="model.createTime" value=""/></td>
			<td><s:textfield disabled="true" name="model.modifier" value=""/></td>
			<td><s:textfield disabled="true" name="model.modifiedTime" value=""/></td>
		</tr>
	</s:form>
	<c:if test="${not empty models}">
	<tbody>
		<c:forEach items="${models}" var="item" varStatus="status">
		<s:form namespace="/setting" method="post" action="addrZip">
 		<s:hidden name="model.id" value="%{#attr.item.id}"/>	
 			<tr>
			<td>
				<s:submit cssClass="button" value="修改" method="update"/>
				<s:submit cssClass="button" value="刪除" method="delete"/>		
			</td>
			<td><s:textfield name="model.addrCode" value="%{#attr.item.addrCode}"/></td>
			<td><s:textfield name="model.addrName" value="%{#attr.item.addrName}"/></td>

			<td><s:textfield readonly="true" name="model.creator" value="%{#attr.item.creator}"/></td>
			<joda:format var="createTime" value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
			<td><s:textfield readonly="true" name="model.createTime" value="%{#attr.createTime}"/></td>
			<td><s:textfield readonly="true" name="model.modifier" value="%{#attr.item.modifier}"/></td>
			<joda:format var="modifiedTime" value="${item.modifiedTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
			<td><s:textfield readonly="true" name="model.modifiedTime" value="%{#attr.modifiedTime}"/></td>
		</tr>
		</s:form>
		</c:forEach>
	</tbody>
	</c:if>
</table>


</body>
</html>


<!-- -----------------------v.2 ------------------------------------------------->

<%-- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Setting - Address Zip</title>

<style>
table {
	font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
	font-size: 12px;
	margin: 0px;
	text-align: left;
	border-collapse: collapse;
	box-shadow: 0 0 10px #333333;
}

th {
	font-size: 13px;
	font-weight: normal;
	padding: 8px;
	background: #ffffff;
	border-top: 4px solid #1e69de;
	border-bottom: 1px solid #fff;
	color: #111111;
	text-shadow: 0px 0px 3px #666666;
}

td {
	padding: 2px;
	background: #eeeeee;
	border-bottom: 1px solid #fff;
	border-top: 1px solid transparent;
}

tr:hover td {
	background: #fefefe;
	box-shadow: inset 0 0px 0 #2f69c2;
	color: #339;
}

.button {
	box-shadow: inset 0 -3px 0 #2f69c2;
	background-image: -webkit-linear- border-radius: 5px;
	border: 1px solid #666666;
	background-color: #ffffff;
	padding: 5px 5px;
	font-family: "Lucida Sans Unicode", "Lucida Grande", 微軟正黑體;
	font-weight: 900;
	outline: none;
	color: #333333;
}

.button:HOVER {
	box-shadow: inset 0 -3px 0 #55B4FF, 0 0 5px #00B4FF;
	background-image: -webkit-linear-
}

.button:ACTIVE {
	box-shadow: inset 0 -3px 0 #ff7400, 0 0 5px #ff7400;
	background-image: -webkit-linear- border:2px solid #ff7400;
}

.button1 {
	box-shadow: inset 0 -3px 0 #299a0b;
	background-image: -webkit-linear- border-radius: 5px;
	border: 1px solid #666666;
	background-color: #ffffff;
	padding: 5px 5px;
	font-family: "Lucida Sans Unicode", "Lucida Grande", 微軟正黑體;
	font-weight: 900;
	outline: none;
	color: #333333;
}

.button1:HOVER {
	box-shadow: inset 0 -3px 0 #8fc800, 0 0 5px #8fc800;
	background-image: -webkit-linear-
}

.button1:ACTIVE {
	box-shadow: inset 0 -3px 0 #ff7400, 0 0 5px #ff7400;
	background-image: -webkit-linear- border:2px solid #ff7400;
}

h1{
	font-family: "Lucida Sans Unicode", "Lucida Grande", 微軟正黑體;
	font-weight: 900;
	text-shadow: 0px 0px 8px #999999;
}

</style>

<script>
	window.onload = function(){
		document.getElementById("openInsert").onclick = openInsert;
		document.getElementById("insertReset").onclick = insertReset;
	}
	
	function openInsert(){
		document.getElementById("insertTr").hidden = false;
	}
	function insertReset(){
		document.getElementById("insertTr").hidden = true;
	}
</script>
</head>

<body>

<h1>Address Zip : ${fn:length(models)} row(s) selected</h1>

<s:form namespace="/setting" method="post">
<input type="text" name="model.addrCode" value=""/>
<input type="text" name="model.addrName" value=""/>
<s:submit cssClass="button1" value="搜尋" action="addrZipSelect"/>
</s:form>

<input class="button1" type="button" id="openInsert" value="新增"/>	
<table>
	<tr>
		<th>FUNCTION</th>
		<th>ID</th>
		<th>CODE</th>
		<th>NAME</th>
		<th>Creator</th>
		<th>CreateTime</th>
		<th>Modifier</th>
		<th>ModifiedTime</th>
	</tr>
	<s:form namespace="/setting" method="post">
	<tr id="insertTr" hidden="true">
		<td><s:submit cssClass="button1" value="送出" action="addrZipInsert" />
			<input class="button1" type="reset" id="insertReset" value="取消" /></td>
			<td><input disabled="disabled" type="text" size="2" name="model.id" value=""/></td>
			<td><input type="text" size="6" name="model.addrCode" value=""/></td>
			<td><input type="text" size="15" name="model.addrName" value=""/></td>
			<td><input disabled="disabled" type="text" size="10" name="model.creator" value=""/></td>
			<td><input disabled="disabled" type="text" size="20" name="model.createTime" value=""/></td>
			<td><input disabled="disabled" type="text" size="10" name="model.modifier" value=""/></td>
			<td><input disabled="disabled" type="text" size="20" name="model.modifiedTime" value=""/></td>
					
	</tr>
	</s:form>
<s:iterator value="models" >
	<s:form namespace="/setting" method="post">
	<tr>
		<td><s:submit cssClass="button" value="修改" action="addrZipUpdate" />
			<s:submit cssClass="button" value="刪除" action="addrZipDelete" /></td>
		<td><input readonly="readonly" type="text" size="2" name="model.id" value="${id}"/></td>
		<td><input type="text" size="6" name="model.addrCode" value="${addrCode}"/></td>
		<td><input type="text" size="15" name="model.addrName" value="${addrName}"/></td>

		<td><input readonly="readonly" type="text" size="10" name="model.creator" value="${creator}"/></td>
			<joda:format var="createTimeJoda" value="${createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
		<td><input readonly="readonly" type="text" size="20" name="model.createTime" value="${createTimeJoda}"/></td>
		<td><input readonly="readonly" type="text" size="10" name="model.modifier" value="${modifier}"/></td>
			<joda:format var="createTimeJoda" value="${modifiedTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
		<td><input readonly="readonly" type="text" size="20" name="model.modifiedTime" value="${createTimeJoda}"/></td>
	</tr>
	</s:form>
</s:iterator>

</table>
<s:if test="%{not empty fieldErrors}">
	<h3>ERRORs:<s:property value="fieldErrors"/></h3>
</s:if>
</body> --%>







<!------------------------ v.1 ------------------------------------------------->


<%-- <body>
<h1>Address Zip List : ${fn:length(models)} row(s) selected</h1>

<input type="button" id="openInsert" value="新增"/>
<table>
	<thead>
		<tr>
			<th>FUNCTION</th>
			<th>CODE</th>
			<th>NAME</th>
			<th>Creator</th>
			<th>CreateTime</th>
			<th>Modifier</th>
			<th>ModifiedTime</th>
		</tr>
	</thead>


	<tbody>

	
		<c:forEach items="${models}" var="item" varStatus="status">
		<tr>
			<td>
				<input type="button" value="修改"/>
				<input type="button" value="刪除"/>			
			</td>
			<td>${item.addrCode}</td>
			<td>${item.addrName}</td>
			<td>${item.creator}</td>
			<td><joda:format value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
			<td>${item.modifier}</td>
			<td><joda:format value="${item.modifiedTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
		</tr>
		</c:forEach>
	</tbody>

</table>


</body> --%>
</html>